// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// import qs from 'qs'

// Vue.prototype.$qs = qs
Vue.prototype.$axios = axios


axios.defaults.baseURL = 'https://www.plusone.top/apex-boundless'
    // axios.defaults config.header["Authorization1"] = 'Bearer ' + wx.getStorageSync("token")
    // 'Accept':'application/json;',
    // 'Content-Type': 'application/json;',
    // "Authorization1":'Bearer ' + sessionStorage.getItem("token")

axios.defaults.headers.common["Authorization1"] = 'Bearer ' + sessionStorage.getItem("token")

/* 请求拦截 */
axios.interceptors.request.use(
    config => {
        if (sessionStorage.getItem("token") != null) {
            config.headers["Authorization1"] = 'Bearer ' + sessionStorage.getItem("token")
        }

        return config;
    },
    err => Promise.reject(err)
);





console.log(axios.defaults)

Vue.use(ElementUI);
// Vue.use(wxlogin);
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    components: { App },
    template: '<App/>'
})